import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:security_defend_wall/security_defend_wall_method_channel.dart';

void main() {
  TestWidgetsFlutterBinding.ensureInitialized();

  MethodChannelSecurityDefendWall platform = MethodChannelSecurityDefendWall();
  const MethodChannel channel = MethodChannel('security_defend_wall');

  setUp(() {
    TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger.setMockMethodCallHandler(channel, (
      MethodCall methodCall,
    ) async {
      return '42';
    });
  });

  tearDown(() {
    TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger.setMockMethodCallHandler(channel, null);
  });

  test('getPlatformVersion', () async {
    expect(await platform.getPlatformVersion(), '42');
  });

  test('isTampered', () async {
    expect(await platform.isTampered('signature', 'iosTeamId'), true);
  });

  test('isRooted', () async {
    expect(await platform.isRooted(), false);
  });

  test('isEmulator', () async {
    expect(await platform.isEmulator(), false);
  });

  test('isDebugged', () async {
    expect(await platform.isDebugged(), false);
  });
}
